//
//  NoDataView.m
//  Shengzhuli
//
//  Created by 卡忙科技 on 16/8/8.
//  Copyright © 2016年 kamangkeji. All rights reserved.
//

#import "NoDataView.h"

@interface NoDataView()

@property (nonatomic,weak) UILabel *lab;

@end

@implementation NoDataView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = RGBColorOne(230);
        UILabel *lab = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, ScreenW, 20)];
        lab.textColor = [UIColor darkGrayColor];
        lab.font = Font(16);
        lab.textAlignment = NSTextAlignmentCenter;
        lab.center = CGPointMake(frame.size.width*0.5, frame.size.height*0.5);
        lab.text = @"抱歉,没有符合条件的商品";
        self.lab = lab;
        [self addSubview:lab];
    }
    return self;
}

- (void)setTips:(NSString *)tips
{
    _tips = tips;
    if (tips.length<1) return;
    self.lab.text = tips;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.lab.center = CGPointMake(self.bounds.size.width*0.5, self.bounds.size.height*0.5);
}

@end
